package TestClass1;

//创建类，this关键字，构造器，封装

public class Test {
    public static void main(String[] args) {
        //当无参数构造器时，会自动创建一个
        //当创建了有参数构造器时，则需要自己写无参数构造器
        Student a=new Student();
        Student b=new Student();
        //-----------------如果令a=b，b的地址会传个a;
        //-----------------此时赋值a=张三，b中的也变成张三
        /*a.name="张三";
        a.chinese=69;
        a.math=74;
        b.name="李四";
        b.chinese=75;
        b.math=86;
         */
        a.SetIn("张三",69,174);//封装后
        b.SetIn("李四",75,86);

        a.PrintTotalScore();
        a.PrintAverageScore();
        b.PrintTotalScore();
        b.PrintAverageScore();
        System.out.println("------------------------------------");

        a.PrintThis();
        b.PrintThis();
        //a.PrintPAss(a.score);
        //b.PrintPAss(b.score);
        a.PrintPAss(a.GetScore());//封装后
        b.PrintPAss(b.GetScore());
        System.out.println("------------------------------------");

        Student c = new Student("王五",160);
        //System.out.println(c.name+"------"+c.score);
        System.out.println(c.GetName()+"-------"+c.GetScore());//封装后
        System.out.println("------------------------------------");
    }
}
